interface DataArrayGroup {
	(arr: any[], num: number): any[][];
}

const dataArrayGroup: DataArrayGroup = (arr, num) => {
	let arr1 = Array.from({ length: Math.ceil(arr.length / num) }, () => [] as any[]);
	for (let i = 0; i < arr.length; i++) {
		const element = arr[i];
		arr1[Math.floor(i / num)].push(element);
	}
	return arr1;
};

export default dataArrayGroup;
